package com.gj.hiltsample

import android.app.Application
import android.util.Log
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
object AppModule {
    @Provides
    fun provideMyApplication(application: Application): AppApplication {
        Log.d("AppModule", "provideMyApplication ----")
        return application as AppApplication
    }

    @Singleton
    @Provides
    fun provideStudentDAO(): StudentDAO {
        Log.d("AppModule", "provideStudentDAO ----")
        return StudentDAO()
    }
}